﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace pc_system.Model
{
    class ProductBuyInfo
    {
        int p_id;
        string p_name;
        float p_sale_price;
        int p_discount;
        int p_count;

        public int P_count
        {
            get { return p_count; }
            set { p_count = value; }
        }

        public float P_now_price
        {
            get { return p_discount * p_sale_price / 100.0f; }
            set { p_discount = (int)(value / p_sale_price); }
        }

        public int P_discount
        {
            get { return p_discount; }
            set { p_discount = value; }
        }

        public float P_sale_price
        {
            get { return p_sale_price; }
            set { p_sale_price = value; }
        }

        public string P_name
        {
            get { return p_name; }
            set { p_name = value; }
        }

        public int P_id
        {
            get { return p_id; }
            set { p_id = value; }
        }
        public float P_sub_total
        {
            get { return p_discount * p_sale_price / 100.0f * p_count; }
        }
    }
}
